 <?php $cuser = $session->read('User'); ?>
<div class="right_side_operate_area">
	<?php  
		if($showpage==1) {
			if(isset($paging)){ echo $this->renderElement('pagination',$paging);} 
		}
	?>
	<div class="right search_box">
		<form onsubmit="return searchinfo()">
	    	<div class="left search_text">
	    		<?php echo $form->text('User.keyword',array('placeholder'=>'搜索用户名','value'=>$keyword, 'id'=>'search', 'class'=>'text_box'));?>
	    	</div>
	        <div class="left search_btn"><input type="submit" value=""/></div>
        </form>
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
</div>
<div class="right_side_scollbar">
	<div class="detail_info_panel">
		<div class="items_list">
			<table>
				<tr>
					<th><?php __('Username');?></th>
			        <th><?php __("Mail") ;?></th>
			        <th><?php __("Tel") ;?></th>
			        <th><?php __("Action") ;?></th>
				</tr>
			<?php foreach ($users as $user): ?>
				<tr class="per_list">
					<td>
					<?php if($user['Attachment']['file_path']){ ?>
						<div class="list_user_name"><span class="user_icon_s"><?php echo $html->image("/".$user['Attachment']['file_path']);?></span><span><?php echo $html->link($user['User']['username'],"/users/view/".$user['User']['id']); ?></span><div class="clear"></div></div>
					<?php }else{ ?>
						<div class="list_user_name"><span class="user_icon_s"><?php echo $html->image('men_tiny.jpg')?></span><span><?php echo $html->link($user['User']['username'],"/users/view/".$user['User']['id']); ?></span><div class="clear"></div></div>
					<?php } ?>
					</td>
					<td><?php echo $user['User']['mail']; ?></td>
					<td><?php echo $user['User']['tel']; ?></td>
					<td>
						<?php 
						if($cuser['isadmin']){
						echo $html->link(__('Edit',true),"/users/edit/".$user['User']['id']);
						}else{
							echo "<span class='enableaction'>编辑</span>";
						}
						if($cuser['isadmin']){
						echo $html->link(__('Delete',true), array('action' => 'delete', $user['User']['id']), array("onclick"=>"return doaction(this)")); 
						}else{
							echo "<span class='enableaction'>删除</span>";
						}
						?> 
					</td>
				</tr>
			<?php 
				endforeach; 
			?>
			</table>
		</div>
	</div>
</div>
<?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>